#pragma once
template <class T>
class smartptr
{
public:
    smartptr(int size)
        : _ptr(new T(size))
    {}
    ~smartptr()
    {
        delete _ptr;
    }
    T* operator->()
    {
        return _ptr;
    }
    T& operator*()
    {
        return *_ptr;
    }
private:
    T* _ptr;
};